package t10086.WorkThread.Shared;

import t10086.Data.Broadcast;
import t10086.Model.Messages.Message;

import java.util.concurrent.ConcurrentLinkedDeque;

public class DataBuffer {
    private static final ConcurrentLinkedDeque<Message> messages = new ConcurrentLinkedDeque<>();
    private static final Broadcast broadcast = new Broadcast();//广播信息
    public static Broadcast getBroadcast() { return broadcast; }

    public static  t10086.Model.Messages.Message pop(){
        return messages.poll();
    }
    public static void push(t10086.Model.Messages.Message s){
        messages.add(s);
    }
    public static void clear(){
        messages.clear();
        broadcast.clear();
    }
}
